Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 8109bce5a3c136f715d296de584bcacd0435c93a


Parents : 2fe2f6b
Author : Mark Qvist <mark@unsigned.io>
Date : 2023-02-17T23:04:44+01:00

Fixed missing path in env

Changes

2 files changed, 8 insertions(+), 2 deletions(-)


Diff

diff --git a/nomadnet/Node.py b/nomadnet/Node.py
index 525cf4c..1ad254b 100644
--- a/nomadnet/Node.py
+++ b/nomadnet/Node.py
@@ -153,6 +153,8 @@ class Node:
RNS.log("Serving page: "+file_path, RNS.LOG_VERBOSE)
if os.access(file_path, os.X_OK):
env_map = {}
+ if "PATH" in os.environ:
+ env_map["PATH"] = os.environ["PATH"]
if link_id != None:
env_map["link_id"] = RNS.hexrep(link_id, delimit=False)
if remote_identity != None:
@@ -248,4 +250,4 @@ If you are the node operator, you can define your own home page by creating a fi
DEFAULT_NOTALLOWED = '''>Request Not Allowed
You are not authorised to carry out the request.
-'''
\ No newline at end of file
+'''

diff --git a/nomadnet/ui/textui/Browser.py b/nomadnet/ui/textui/Browser.py
index 372f190..7907e65 100644
--- a/nomadnet/ui/textui/Browser.py
+++ b/nomadnet/ui/textui/Browser.py
@@ -719,6 +719,10 @@ class Browser:
env_map = self.request_data
else:
env_map = {}
+
+ if "PATH" in os.environ:
+ env_map["PATH"] = os.environ["PATH"]
+
generated = subprocess.run([page_path], stdout=subprocess.PIPE, env=env_map)
page_data = generated.stdout
else:
@@ -1108,4 +1112,4 @@ class UrlEdit(urwid.Edit):
if key == "enter":
self.confirmed(self)
else:
- return super(UrlEdit, self).keypress(size, key)
\ No newline at end of file
+ return super(UrlEdit, self).keypress(size, key)


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────